package com.takeoutsystem.event.publisher;

import com.takeoutsystem.bean.StorageRemainShow;
import com.takeoutsystem.event.message.GetOrderMailEvent;
import com.takeoutsystem.event.message.TimeOutMailEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

@Component
public  class SendMailPublisher {
    @Autowired
    ApplicationContext context;

    public void sendGetOrderMail(StorageRemainShow remainInfo){
        context.publishEvent(new GetOrderMailEvent(this,remainInfo));
    }
    public void sendTimeOutMail(StorageRemainShow remainInfo){
        context.publishEvent(new TimeOutMailEvent(this,remainInfo));
    }

}
